﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Gollie.DataTables;

namespace Gollie.Controls
{
	public partial class PaymentOptionChoice : AuthenticationRequiredCustomerBaseUserControl
	{
		protected override void OnFirstHit(object sender, EventArgs e)
		{
			OrderBasketData orders = this.OrderBasketData;

			if (orders == null || orders.Count == 0)
			{
				this.ErrorMessageControl1.Text = "Uw winkelwagen is leeg.";
				this.ErrorMessageControl1.Show();
				this.pnlPaymentMethod.Visible = false;
			}
			else
			{
				decimal totPrice;
				decimal totCredit;
				this.OrderBasketData.Sum(out totCredit, out totPrice);
				this.lblAmount.Text = totPrice.ToString("c2");
			}
		}
	}
}